use askama::Template;
use axum::{extract::Query, response::IntoResponse};
use tower_cookies::Cookies;

use crate::{CommParam, TemplateResponse};

use super::base::{base, BaseData};
use crate::template::filters;

#[derive(Template)]
#[template(path = "login.html")]
pub struct LoginTemplate {
    redirect: Option<String>,
    base: BaseData,
}
pub async fn index(cookies: Cookies, param: Query<CommParam>) -> impl IntoResponse {
    let template = LoginTemplate {
        redirect: param.0.redirect,
        base: base(cookies).await,
    };
    TemplateResponse(template)
}
